home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / RMTP03.ARJ / WRITEXGF.PAS < prev   
Pascal/Delphi Source File  |  1992-02-25  |  1KB  |  38 lines

  1.  
  2. Program WriteXgf;
  3.  Uses Graph;
  4. Var
  5.  F    : File;
  6.  Img  : Pointer;
  7.  Size : Word;
  8.  Gd   : Integer;
  9.  Gm   : Integer;
  10. Begin
  11.  Gd:=EGA;
  12.  Gm:=EGAhi;
  13.  InitGraph(Gd,Gm,'');                      (* Set path where EGAVGA.BGI *)
  14.                                            (* is located                *)
  15.  SetFillStyle(SolidFill,Blue);
  16.  Bar(0,0,639,349);
  17.  
  18.  SetFillStyle(SlashFill,LightGray);
  19.  Bar(2,2,49,49);
  20.  SetColor(White);
  21.  Rectangle(1,1,50,50);
  22.  SetColor(LightGreen);
  23.  OutTextXY(2,10,'RASTER');
  24.  OutTextXY(2,30,'MASTER');                 (* Draw something            *)
  25.  
  26.  Size:=ImageSize(1,1,50,50);
  27.  GetMem(Img,Size);
  28.  GetImage(1,1,50,50,Img^);                 (* Grab the image from screen*)
  29.                                            (* and store in Img buffer   *)
  30.  Assign(F,'BOX.XGF');
  31.  ReWrite(F,1);
  32.  BlockWrite(F,Img^,Size);
  33.  Close(F);                                 (* Save the Image            *)
  34.  
  35.  FreeMem(Img,Size);                        (* Release the memory        *)
  36.  ReadLn;                                   (* Wait for enter key        *)
  37.  CloseGraph;                               (* Close graphics            *)
  38. End.